{extend name='public/login'/}
<!-- 样式 -->
{block name='style'}
<style>
    .login-form-shade {
        background-color: #01AAED;
    }

    .login-form {
        /* 水平垂直绝对居中 */
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 380px;
        height: 320px;
        margin: auto;
        padding: 20px;
        border: 1px solid #eee;
        border-radius: 4px;
        box-shadow: 5px 5px 20px #333;
        background-color: #fff;
    }

    @media screen and (max-width: 440px) {
        .login-form {
            width: calc(100% - 60px);
        }
    }
</style>
{/block}

<!-- 头部 -->
{block name='head'}
<div class="login-title">
    <div class="layui-form-item">
        <h2>管理系统登录</h2>
    </div>
    <hr />
</div>
{:token_field()}
{/block}

<!-- js -->
{block name='js'}
<script>
    // 请求路径
    var url = "/admins/account/dologin";
    var redirect = "";
    // 为方便前端弹窗登录（框架引入），去除样式
    if (self.frameElement && self.frameElement.tagName == 'IFRAME') {
        document.body.classList.remove('login-form-shade');
        document.getElementsByClassName('login-title')[0].remove();
        document.getElementsByClassName('layui-form')[0].classList.remove('login-form');
    } else {
        redirect = '/admins/home/index/';
        document.body.classList.add('login-form-shade');
        document.getElementsByClassName('layui-form')[0].classList.add('login-form');
    }
</script>
{/block}